3.33 \(\int (a+b \tan (c+d \sqrt{x}))^2 \, dx\)

Optimal. Leaf size=119 \[ \frac{2 i a b \text{PolyLog}\left (2,-e^{2 i \left (c+d \sqrt{x}\right )}\right )}{d^2}+a^2 x-\frac{4 a b \sqrt{x} \log \left (1+e^{2 i \left (c+d \sqrt{x}\right )}\right )}{d}+2 i a b x+\frac{2 b^2 \log \left (\cos \left (c+d \sqrt{x}\right )\right )}{d^2}+\frac{2 b^2 \sqrt{x} \tan \left (c+d \sqrt{x}\right )}{d}-b^2 x \]

[Out]

a^2*x + (2*I)*a*b*x - b^2*x - (4*a*b*Sqrt[x]*Log[1 + E^((2*I)*(c + d*Sqrt[x]))])/d + (2*b^2*Log[Cos[c + d*Sqrt
[x]]])/d^2 + ((2*I)*a*b*PolyLog[2, -E^((2*I)*(c + d*Sqrt[x]))])/d^2 + (2*b^2*Sqrt[x]*Tan[c + d*Sqrt[x]])/d

________________________________________________________________________________________

Rubi [A]  time = 0.176802, antiderivative size = 119, normalized size of antiderivative = 1., number of steps used = 10, number of rules used = 9, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.562, Rules used = {3739, 3722, 3719, 2190, 2279, 2391, 3720, 3475, 30} \[ a^2 x+\frac{2 i a b \text{Li}_2\left (-e^{2 i \left (c+d \sqrt{x}\right )}\right )}{d^2}-\frac{4 a b \sqrt{x} \log \left (1+e^{2 i \left (c+d \sqrt{x}\right )}\right )}{d}+2 i a b x+\frac{2 b^2 \log \left (\cos \left (c+d \sqrt{x}\right )\right )}{d^2}+\frac{2 b^2 \sqrt{x} \tan \left (c+d \sqrt{x}\right )}{d}-b^2 x \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Tan[c + d*Sqrt[x]])^2,x]

[Out]

a^2*x + (2*I)*a*b*x - b^2*x - (4*a*b*Sqrt[x]*Log[1 + E^((2*I)*(c + d*Sqrt[x]))])/d + (2*b^2*Log[Cos[c + d*Sqrt
[x]]])/d^2 + ((2*I)*a*b*PolyLog[2, -E^((2*I)*(c + d*Sqrt[x]))])/d^2 + (2*b^2*Sqrt[x]*Tan[c + d*Sqrt[x]])/d

Rule 3739

Int[((a_.) + (b_.)*Tan[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(1/n - 1)*(a + b*Ta
n[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, p}, x] && IGtQ[1/n, 0] && IntegerQ[p]

Rule 3722

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[ExpandIntegrand[
(c + d*x)^m, (a + b*Tan[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[m, 0] && IGtQ[n, 0]

Rule 3719

Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(I*(c + d*x)^(m + 1))/(d*(m + 1)), x
] - Dist[2*I, Int[((c + d*x)^m*E^(2*I*(e + f*x)))/(1 + E^(2*I*(e + f*x))), x], x] /; FreeQ[{c, d, e, f}, x] &&
 IGtQ[m, 0]

Rule 2190

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m*Log[1 + (b*(F^(g*(e + f*x)))^n)/a])/(b*f*g*n*Log[F]), x]
 - Dist[(d*m)/(b*f*g*n*Log[F]), Int[(c + d*x)^(m - 1)*Log[1 + (b*(F^(g*(e + f*x)))^n)/a], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2279

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2391

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> -Simp[PolyLog[2, -(c*e*x^n)]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 3720

Int[((c_.) + (d_.)*(x_))^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(c + d*x)^m*(b*Tan[e
 + f*x])^(n - 1))/(f*(n - 1)), x] + (-Dist[(b*d*m)/(f*(n - 1)), Int[(c + d*x)^(m - 1)*(b*Tan[e + f*x])^(n - 1)
, x], x] - Dist[b^2, Int[(c + d*x)^m*(b*Tan[e + f*x])^(n - 2), x], x]) /; FreeQ[{b, c, d, e, f}, x] && GtQ[n,
1] && GtQ[m, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rubi steps

\begin{align*} \int \left (a+b \tan \left (c+d \sqrt{x}\right )\right )^2 \, dx &=2 \operatorname{Subst}\left (\int x (a+b \tan (c+d x))^2 \, dx,x,\sqrt{x}\right )\\ &=2 \operatorname{Subst}\left (\int \left (a^2 x+2 a b x \tan (c+d x)+b^2 x \tan ^2(c+d x)\right ) \, dx,x,\sqrt{x}\right )\\ &=a^2 x+(4 a b) \operatorname{Subst}\left (\int x \tan (c+d x) \, dx,x,\sqrt{x}\right )+\left (2 b^2\right ) \operatorname{Subst}\left (\int x \tan ^2(c+d x) \, dx,x,\sqrt{x}\right )\\ &=a^2 x+2 i a b x+\frac{2 b^2 \sqrt{x} \tan \left (c+d \sqrt{x}\right )}{d}-(8 i a b) \operatorname{Subst}\left (\int \frac{e^{2 i (c+d x)} x}{1+e^{2 i (c+d x)}} \, dx,x,\sqrt{x}\right )-\left (2 b^2\right ) \operatorname{Subst}\left (\int x \, dx,x,\sqrt{x}\right )-\frac{\left (2 b^2\right ) \operatorname{Subst}\left (\int \tan (c+d x) \, dx,x,\sqrt{x}\right )}{d}\\ &=a^2 x+2 i a b x-b^2 x-\frac{4 a b \sqrt{x} \log \left (1+e^{2 i \left (c+d \sqrt{x}\right )}\right )}{d}+\frac{2 b^2 \log \left (\cos \left (c+d \sqrt{x}\right )\right )}{d^2}+\frac{2 b^2 \sqrt{x} \tan \left (c+d \sqrt{x}\right )}{d}+\frac{(4 a b) \operatorname{Subst}\left (\int \log \left (1+e^{2 i (c+d x)}\right ) \, dx,x,\sqrt{x}\right )}{d}\\ &=a^2 x+2 i a b x-b^2 x-\frac{4 a b \sqrt{x} \log \left (1+e^{2 i \left (c+d \sqrt{x}\right )}\right )}{d}+\frac{2 b^2 \log \left (\cos \left (c+d \sqrt{x}\right )\right )}{d^2}+\frac{2 b^2 \sqrt{x} \tan \left (c+d \sqrt{x}\right )}{d}-\frac{(2 i a b) \operatorname{Subst}\left (\int \frac{\log (1+x)}{x} \, dx,x,e^{2 i \left (c+d \sqrt{x}\right )}\right )}{d^2}\\ &=a^2 x+2 i a b x-b^2 x-\frac{4 a b \sqrt{x} \log \left (1+e^{2 i \left (c+d \sqrt{x}\right )}\right )}{d}+\frac{2 b^2 \log \left (\cos \left (c+d \sqrt{x}\right )\right )}{d^2}+\frac{2 i a b \text{Li}_2\left (-e^{2 i \left (c+d \sqrt{x}\right )}\right )}{d^2}+\frac{2 b^2 \sqrt{x} \tan \left (c+d \sqrt{x}\right )}{d}\\ \end{align*}

Mathematica [B]  time = 6.28, size = 308, normalized size = 2.59 \[ -\frac{2 a b \csc (c) \sec (c) \left (d^2 x e^{-i \tan ^{-1}(\cot (c))}-\frac{\cot (c) \left (i \text{PolyLog}\left (2,e^{2 i \left (d \sqrt{x}-\tan ^{-1}(\cot (c))\right )}\right )+i d \sqrt{x} \left (-2 \tan ^{-1}(\cot (c))-\pi \right )-2 \left (d \sqrt{x}-\tan ^{-1}(\cot (c))\right ) \log \left (1-e^{2 i \left (d \sqrt{x}-\tan ^{-1}(\cot (c))\right )}\right )-2 \tan ^{-1}(\cot (c)) \log \left (\sin \left (d \sqrt{x}-\tan ^{-1}(\cot (c))\right )\right )-\pi \log \left (1+e^{-2 i d \sqrt{x}}\right )+\pi \log \left (\cos \left (d \sqrt{x}\right )\right )\right )}{\sqrt{\cot ^2(c)+1}}\right )}{d^2 \sqrt{\csc ^2(c) \left (\sin ^2(c)+\cos ^2(c)\right )}}+x \sec (c) \left (a^2 \cos (c)+2 a b \sin (c)-b^2 \cos (c)\right )+\frac{2 b^2 \sec (c) \left (d \sqrt{x} \sin (c)+\cos (c) \log \left (\cos (c) \cos \left (d \sqrt{x}\right )-\sin (c) \sin \left (d \sqrt{x}\right )\right )\right )}{d^2 \left (\sin ^2(c)+\cos ^2(c)\right )}+\frac{2 b^2 \sqrt{x} \sec (c) \sin \left (d \sqrt{x}\right ) \sec \left (c+d \sqrt{x}\right )}{d} \]

Warning: Unable to verify antiderivative.

[In]

Integrate[(a + b*Tan[c + d*Sqrt[x]])^2,x]

[Out]

x*Sec[c]*(a^2*Cos[c] - b^2*Cos[c] + 2*a*b*Sin[c]) + (2*b^2*Sec[c]*(Cos[c]*Log[Cos[c]*Cos[d*Sqrt[x]] - Sin[c]*S
in[d*Sqrt[x]]] + d*Sqrt[x]*Sin[c]))/(d^2*(Cos[c]^2 + Sin[c]^2)) - (2*a*b*Csc[c]*((d^2*x)/E^(I*ArcTan[Cot[c]])
- (Cot[c]*(I*d*Sqrt[x]*(-Pi - 2*ArcTan[Cot[c]]) - Pi*Log[1 + E^((-2*I)*d*Sqrt[x])] - 2*(d*Sqrt[x] - ArcTan[Cot
[c]])*Log[1 - E^((2*I)*(d*Sqrt[x] - ArcTan[Cot[c]]))] + Pi*Log[Cos[d*Sqrt[x]]] - 2*ArcTan[Cot[c]]*Log[Sin[d*Sq
rt[x] - ArcTan[Cot[c]]]] + I*PolyLog[2, E^((2*I)*(d*Sqrt[x] - ArcTan[Cot[c]]))]))/Sqrt[1 + Cot[c]^2])*Sec[c])/
(d^2*Sqrt[Csc[c]^2*(Cos[c]^2 + Sin[c]^2)]) + (2*b^2*Sqrt[x]*Sec[c]*Sec[c + d*Sqrt[x]]*Sin[d*Sqrt[x]])/d

________________________________________________________________________________________

Maple [F]  time = 0.215, size = 0, normalized size = 0. \begin{align*} \int \left ( a+b\tan \left ( c+d\sqrt{x} \right ) \right ) ^{2}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*tan(c+d*x^(1/2)))^2,x)

[Out]

int((a+b*tan(c+d*x^(1/2)))^2,x)

________________________________________________________________________________________

Maxima [B]  time = 2.30698, size = 676, normalized size = 5.68 \begin{align*} a^{2} x + \frac{4 \, b^{2} d \sqrt{x} +{\left (4 \, a b \cos \left (2 \, d \sqrt{x} + 2 \, c\right ) + 4 i \, a b \sin \left (2 \, d \sqrt{x} + 2 \, c\right ) + 4 \, a b\right )} \arctan \left (\sin \left (2 \, d \sqrt{x} - 2 \, c\right ), \cos \left (2 \, d \sqrt{x} - 2 \, c\right ) + 1\right ) \arctan \left (\sin \left (d \sqrt{x}\right ), \cos \left (d \sqrt{x}\right )\right ) +{\left (-2 i \, a b \cos \left (2 \, d \sqrt{x} + 2 \, c\right ) + 2 \, a b \sin \left (2 \, d \sqrt{x} + 2 \, c\right ) - 2 i \, a b\right )} \arctan \left (\sin \left (d \sqrt{x}\right ), \cos \left (d \sqrt{x}\right )\right ) \log \left (\cos \left (2 \, d \sqrt{x} - 2 \, c\right )^{2} + \sin \left (2 \, d \sqrt{x} - 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d \sqrt{x} - 2 \, c\right ) + 1\right ) -{\left ({\left (2 \, a b - i \, b^{2}\right )} d^{2} \cos \left (2 \, d \sqrt{x} + 2 \, c\right ) -{\left (-2 i \, a b - b^{2}\right )} d^{2} \sin \left (2 \, d \sqrt{x} + 2 \, c\right ) +{\left (2 \, a b - i \, b^{2}\right )} d^{2}\right )} x +{\left (2 \, b^{2} \cos \left (2 \, d \sqrt{x} + 2 \, c\right ) + 2 i \, b^{2} \sin \left (2 \, d \sqrt{x} + 2 \, c\right ) + 2 \, b^{2}\right )} \arctan \left (\sin \left (2 \, d \sqrt{x}\right ) + \sin \left (2 \, c\right ), \cos \left (2 \, d \sqrt{x}\right ) + \cos \left (2 \, c\right )\right ) -{\left (2 \, a b \cos \left (2 \, d \sqrt{x} + 2 \, c\right ) + 2 i \, a b \sin \left (2 \, d \sqrt{x} + 2 \, c\right ) + 2 \, a b\right )}{\rm Li}_2\left (-e^{\left (2 i \, d \sqrt{x} - 2 i \, c\right )}\right ) +{\left (-i \, b^{2} \cos \left (2 \, d \sqrt{x} + 2 \, c\right ) + b^{2} \sin \left (2 \, d \sqrt{x} + 2 \, c\right ) - i \, b^{2}\right )} \log \left (\cos \left (2 \, d \sqrt{x}\right )^{2} + 2 \, \cos \left (2 \, d \sqrt{x}\right ) \cos \left (2 \, c\right ) + \cos \left (2 \, c\right )^{2} + \sin \left (2 \, d \sqrt{x}\right )^{2} + 2 \, \sin \left (2 \, d \sqrt{x}\right ) \sin \left (2 \, c\right ) + \sin \left (2 \, c\right )^{2}\right )}{-i \, d^{2} \cos \left (2 \, d \sqrt{x} + 2 \, c\right ) + d^{2} \sin \left (2 \, d \sqrt{x} + 2 \, c\right ) - i \, d^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(c+d*x^(1/2)))^2,x, algorithm="maxima")

[Out]

a^2*x + (4*b^2*d*sqrt(x) + (4*a*b*cos(2*d*sqrt(x) + 2*c) + 4*I*a*b*sin(2*d*sqrt(x) + 2*c) + 4*a*b)*arctan2(sin
(2*d*sqrt(x) - 2*c), cos(2*d*sqrt(x) - 2*c) + 1)*arctan2(sin(d*sqrt(x)), cos(d*sqrt(x))) + (-2*I*a*b*cos(2*d*s
qrt(x) + 2*c) + 2*a*b*sin(2*d*sqrt(x) + 2*c) - 2*I*a*b)*arctan2(sin(d*sqrt(x)), cos(d*sqrt(x)))*log(cos(2*d*sq
rt(x) - 2*c)^2 + sin(2*d*sqrt(x) - 2*c)^2 + 2*cos(2*d*sqrt(x) - 2*c) + 1) - ((2*a*b - I*b^2)*d^2*cos(2*d*sqrt(
x) + 2*c) - (-2*I*a*b - b^2)*d^2*sin(2*d*sqrt(x) + 2*c) + (2*a*b - I*b^2)*d^2)*x + (2*b^2*cos(2*d*sqrt(x) + 2*
c) + 2*I*b^2*sin(2*d*sqrt(x) + 2*c) + 2*b^2)*arctan2(sin(2*d*sqrt(x)) + sin(2*c), cos(2*d*sqrt(x)) + cos(2*c))
 - (2*a*b*cos(2*d*sqrt(x) + 2*c) + 2*I*a*b*sin(2*d*sqrt(x) + 2*c) + 2*a*b)*dilog(-e^(2*I*d*sqrt(x) - 2*I*c)) +
 (-I*b^2*cos(2*d*sqrt(x) + 2*c) + b^2*sin(2*d*sqrt(x) + 2*c) - I*b^2)*log(cos(2*d*sqrt(x))^2 + 2*cos(2*d*sqrt(
x))*cos(2*c) + cos(2*c)^2 + sin(2*d*sqrt(x))^2 + 2*sin(2*d*sqrt(x))*sin(2*c) + sin(2*c)^2))/(-I*d^2*cos(2*d*sq
rt(x) + 2*c) + d^2*sin(2*d*sqrt(x) + 2*c) - I*d^2)

________________________________________________________________________________________

Fricas [B]  time = 1.7668, size = 527, normalized size = 4.43 \begin{align*} \frac{2 \, b^{2} d \sqrt{x} \tan \left (d \sqrt{x} + c\right ) +{\left (a^{2} - b^{2}\right )} d^{2} x - i \, a b{\rm Li}_2\left (\frac{2 \,{\left (i \, \tan \left (d \sqrt{x} + c\right ) - 1\right )}}{\tan \left (d \sqrt{x} + c\right )^{2} + 1} + 1\right ) + i \, a b{\rm Li}_2\left (\frac{2 \,{\left (-i \, \tan \left (d \sqrt{x} + c\right ) - 1\right )}}{\tan \left (d \sqrt{x} + c\right )^{2} + 1} + 1\right ) -{\left (2 \, a b d \sqrt{x} - b^{2}\right )} \log \left (-\frac{2 \,{\left (i \, \tan \left (d \sqrt{x} + c\right ) - 1\right )}}{\tan \left (d \sqrt{x} + c\right )^{2} + 1}\right ) -{\left (2 \, a b d \sqrt{x} - b^{2}\right )} \log \left (-\frac{2 \,{\left (-i \, \tan \left (d \sqrt{x} + c\right ) - 1\right )}}{\tan \left (d \sqrt{x} + c\right )^{2} + 1}\right )}{d^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(c+d*x^(1/2)))^2,x, algorithm="fricas")

[Out]

(2*b^2*d*sqrt(x)*tan(d*sqrt(x) + c) + (a^2 - b^2)*d^2*x - I*a*b*dilog(2*(I*tan(d*sqrt(x) + c) - 1)/(tan(d*sqrt
(x) + c)^2 + 1) + 1) + I*a*b*dilog(2*(-I*tan(d*sqrt(x) + c) - 1)/(tan(d*sqrt(x) + c)^2 + 1) + 1) - (2*a*b*d*sq
rt(x) - b^2)*log(-2*(I*tan(d*sqrt(x) + c) - 1)/(tan(d*sqrt(x) + c)^2 + 1)) - (2*a*b*d*sqrt(x) - b^2)*log(-2*(-
I*tan(d*sqrt(x) + c) - 1)/(tan(d*sqrt(x) + c)^2 + 1)))/d^2

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan{\left (c + d \sqrt{x} \right )}\right )^{2}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(c+d*x**(1/2)))**2,x)

[Out]

Integral((a + b*tan(c + d*sqrt(x)))**2, x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \tan \left (d \sqrt{x} + c\right ) + a\right )}^{2}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(c+d*x^(1/2)))^2,x, algorithm="giac")

[Out]

integrate((b*tan(d*sqrt(x) + c) + a)^2, x)